import noPermission from '@/views/error/noPermission.vue'
import useAuthStore from '@/store/auth'
import pinia from '@/store'

const authStore = useAuthStore(pinia)

export default [
  // {
  //   path: '/menuManage/index',
  //   component: () => import('@/views/menuManage/index.vue'),
  //   meta: {
  //     title: '菜单管理',
  //     icon: 'menu',
  //   },
  //   show: true,
  // },
  {
    path: '',
    component: '',
    meta: {
      title: '客户',
      icon: 'custom2',
      controls: 'custom'
    },
    show: true,
    children: [
      {
        path: '/custom/index',
        component: () => authStore.permission.includes('custom') ? import('@/views/custom/index.vue') : noPermission,
        meta: {
          title: '客户管理',
          icon: 'customer',
        },
        show: true,
      },
      {
        path: '/custom/details',
        component: () => authStore.permission.includes('custom') ? import('@/views/custom/details.vue') : noPermission,
        meta: {
          title: '客户详情',
          icon: 'menu',
        },
        show: false,
      },
    ],
  },
  {
    path: '',
    meta: {
      title: '招聘',
      icon: 'zhaopin',
      controls: 'template'
    },
    show: true,
    children: [
      // {
      //   path: '/recruit/index',
      //   component: () => import('@/views/error/building.vue'),
      //   meta: {
      //     title: '招聘',
      //     icon: 'menu',
      //   },
      //   show: true,
      // },
      {
        path: '/recruit/formwork',
        component: () => authStore.permission.includes('template') ? import('@/views/recruit/formwork/index.vue') : noPermission,
        meta: {
          title: '招聘模版',
          icon: 'muban',
        },
        show: true,
      },
    ],
  },

  {
    path: '',
    meta: {
      title: '培训',
      icon: 'peixun',
      controls: 'course'
    },
    show: true,
    children: [
      {
        path: '/course/index',
        component: () => authStore.permission.includes('course') ? import('@/views/course/index.vue') : noPermission,
        meta: {
          title: '课程库',
          icon: 'kecheng',
        },
        show: true,
      },
      {
        path: '/course/details',
        component: () => authStore.permission.includes('course') ? import('@/views/course/details.vue') : noPermission,
        meta: {
          title: '课程详情',
          icon: 'menu',
        },
        show: false,
      },
      {
        path: '/train/group',
        component: () => import('@/views/group/index.vue'),
        meta: {
          title: '学习小组',
          icon: 'menu',
        },
      },
      {
        path: '/ip/iconList',
        component: () => authStore.permission.includes('ip') ? import('@/views/ip/iconList.vue') : noPermission,
        meta: {
          title: '图标库',
          icon: 'beijingtu',
        },
        show: true,
      },
    ],
  },

  {
    path: '',
    meta: {
      title: '评价',
      icon: 'pingjia',
      controls: 'evaluate'
    },
    show: true,
    children: [
      {
        path: '/evaluate/index',
        component: () => authStore.permission.includes('evaluate') ? import('@/views/evaluate/index.vue') : noPermission,
        meta: {
          title: '评价',
          icon: 'pingjia',
        },
        show: true,
      },
      {
        path: '/evaluate/form',
        component: () => authStore.permission.includes('evaluate') ? import('@/views/evaluate/form.vue') : noPermission,
        meta: {
          title: '评价模板',
          icon: 'menu',
        },
        show: false,
      },
    ],
  },

  {
    path: '',
    meta: {
      title: 'IP学院',
      icon: 'ip',
      controls: 'ip'
    },
    show: true,
    children: [
      {
        path: '/ip/backgroundImage',
        component: () => authStore.permission.includes('ip') ? import('@/views/ip/backgroundImage.vue') : noPermission,
        meta: {
          title: '背景图管理',
          icon: 'beijingtu',
        },
        show: true,
      },
      {
        path: '/ip/materials/categories',
        component: () => authStore.permission.includes('ip') ? import('@/views/ip/categories.vue') : noPermission,
        meta: {
          title: '分类管理',
          icon: 'material_category',
        },
        show: true,
      },
      {
        path: '/ip/materials',
        component: () => authStore.permission.includes('ip') ? import('@/views/ip/materials.vue') : noPermission,
        meta: {
          title: '素材管理',
          icon: 'sucai',
        },
        show: true,
      },
      {
        path: '/ip/feedback',
        component: () => authStore.permission.includes('ip') ? import('@/views/ip/feedback/index.vue') : noPermission,
        meta: {
          title: '意见反馈',
          icon: 'yijian',
        },
        show: true,
      },
      {
        path: '/ip/resources',
        component: () => authStore.permission.includes('ip') ? import('@/views/ip/resources.vue') : noPermission,
        meta: {
          title: '资源维护',
          icon: 'ziyuan',
        },
        show: true,
      },
    ],
  },

  {
    path: '',
    meta: {
      title: '管理',
      icon: 'menu',
      controls: 'system'
    },
    show: true,
    children: [
      {
        path: '/governance/department',
        component: () => authStore.permission.includes('system') ? import('@/views/governance/department.vue') : noPermission,
        meta: {
          title: '部门管理',
          icon: 'bumen',
        },
        show: false,
      },
      {
        path: '/governance/position',
        component: () => authStore.permission.includes('system') ? import('@/views/governance/position.vue') : noPermission,
        meta: {
          title: '岗位管理',
          icon: 'gangwei',
        },
        show: false,
      },
      {
        path: '/governance/personnel',
        component: () => authStore.permission.includes('system') ? import('@/views/governance/personnel.vue') : noPermission,
        meta: {
          title: '人员管理',
          icon: 'renyuan',
        },
        show: true,
      },
      {
        path: '/governance/bulletinBoard',
        component: () => authStore.permission.includes('system') ? import('@/views/governance/bulletinBoard.vue') : noPermission,
        meta: {
          title: '宣传栏管理',
          icon: 'xuanchuanlan',
        },
        show: true,
      },
      {
        path: '/governance/order',
        component: () => authStore.permission.includes('system') ? import('@/views/governance/order.vue') : noPermission,
        meta: {
          title: '订单管理',
          icon: 'dingdan',
        },
        show: true,
      },
    ],
  },
]